WEBVTT

00:00.950 --> 00:07.270
In the last video we included the sharp rise so to our portfolio analysis and to our graph here is a

00:07.280 --> 00:09.320
couple of the portfolios.

00:09.320 --> 00:15.740
And in this video we will identify the best portfolio with the highest chop ratio the so-called maximum

00:15.740 --> 00:17.690
sharp ratio portfolio.

00:17.690 --> 00:21.330
And this should be somewhere here in this region.

00:21.440 --> 00:23.390
So we have still important.

00:23.480 --> 00:31.130
The portfolio summary data frame with our 100 thousand portfolios and the annualized the return risk

00:31.160 --> 00:33.080
and the ratio.

00:33.080 --> 00:40.910
And we again can also call the scribe method here and we can see that the best portfolio has a sharp

00:40.910 --> 00:47.780
ratio of one point eighteen and in the next step we want to find exactly this portfolio.

00:48.140 --> 00:56.500
But first of all we have also here the weights matrix with the weights of the 100000 portfolios and

00:56.570 --> 01:03.740
we want to find the max sharp racial portfolio and we can do this by selecting the shop column of our

01:03.740 --> 01:10.970
portfolio summary data frame and then we use the idea X Max method and by doing so append us actually

01:10.970 --> 01:19.310
returns as the index labor of uh the portfolio with the highest chop ratio and we can also look at inside

01:19.310 --> 01:20.690
the idea X Max method.

01:20.690 --> 01:22.050
So let's have a look here.

01:22.070 --> 01:30.440
So the idea X Max method returns the roll label of the maximum value in this case in the shop column

01:31.010 --> 01:36.180
and then we actually save for the row label and the variable maximum Sharpe Ratio portfolio.

01:36.650 --> 01:39.310
So let's do this here and let's have a look.

01:39.320 --> 01:43.040
So we have 100000 portfolios and.

01:43.190 --> 01:50.930
The portfolio with the indexed label seventy six thousand eight hundred seventy nine has the highest

01:50.930 --> 01:57.650
chop ratio of one point eighty in and now we can also select the row with the maximum Sharpe ratio in

01:57.650 --> 02:04.400
our portfolio summary data frame and of course we can do this with the ILO operator and we pass here

02:04.490 --> 02:05.720
the ROE label.

02:06.710 --> 02:07.510
Let's have a look here.

02:08.820 --> 02:15.570
So here the very best portfolio gives us a an annualized return of 25 percent.

02:15.570 --> 02:19.400
We have a risk in terms of standard deviation of 19 percent.

02:19.560 --> 02:26.490
And of course we uh the shop ratio the max job ratio of one point eighteen and that's actually the portfolio

02:26.490 --> 02:30.480
with the number seventy six thousand eight hundred seventy nine.

02:30.630 --> 02:38.660
And we can also get the weights of this portfolio by passing the ROE label of the best portfolio which

02:38.670 --> 02:44.750
is also the index positions so we have a uh Range Index starting from zero.

02:44.760 --> 02:51.360
So we pass here the index position to the weights matrix and then we get the weights of uh this best

02:51.360 --> 03:00.220
portfolio and we save the weights and the variable maximum sharp racial portfolio weights so here we

03:00.220 --> 03:07.390
have uh the six weights and to have a better overview we can also create a panda series with the stock

03:07.390 --> 03:09.580
ticker as the index.

03:09.580 --> 03:10.900
And are our weights.

03:10.900 --> 03:13.710
So let's do this and let's have a look.

03:14.190 --> 03:21.960
So here in our best portfolio we have for the Amazon stock a rate of 27 percent for the Boeing column

03:21.960 --> 03:23.730
of 39 percent.

03:23.730 --> 03:25.760
Then we have only one point seven percent.

03:25.770 --> 03:36.240
This may then almost 0 percent IBM 5 percent Coca-Cola and the 25 percent Microsoft in our portfolio.

03:36.250 --> 03:43.560
And this is actually the best portfolio of our 100000 random portfolios but it's actually not the absolutely

03:43.560 --> 03:45.090
best portfolio.

03:45.180 --> 03:54.320
So we can also optimize for the very best portfolio by using some advanced optimization algorithms.

03:54.540 --> 03:57.640
But this is clearly beyond the scope of this course.

03:57.750 --> 04:04.650
And I have done this in the background and I could solve for the weights of the very best portfolio.

04:04.740 --> 04:09.840
So we say for the weights and the variable optimal weights and let's have a look here.

04:09.990 --> 04:15.190
So by using some optimization algorithms we get here the very best portfolio.

04:15.330 --> 04:23.040
And here we can see that we have zero weight for Disney IBM and Coca-Cola and the 25 percent for Amazon

04:23.040 --> 04:28.020
35 percent for Boeing and 39 percent for Microsoft.

04:28.020 --> 04:32.220
So this is our very best portfolio are the weights of our very best portfolio.

04:32.670 --> 04:36.720
And then we can also create the evaded average daily returns.

04:36.840 --> 04:44.130
For this portfolio and we create a new column for our returns data frame and we will see the top method

04:44.160 --> 04:46.200
and pass the optimal weights.

04:46.210 --> 04:48.840
So let's do this and let's have a look.

04:48.840 --> 04:50.790
So here we have our six constituents.

04:50.790 --> 04:58.570
And on the right hand side that daily returns of the maximum Sharpe Ratio portfolio MP and we can also

04:58.570 --> 05:04.900
create these summary data frame by passing the returns that are frame to our user defined function annualized

05:04.900 --> 05:06.250
the risk and return.

05:06.250 --> 05:07.930
So let's do this.

05:07.930 --> 05:14.710
And we also add the column shop with the top ratio which is the portfolio return minus the return of

05:14.710 --> 05:18.070
the risk free rate divided by the risk of the portfolio.

05:18.070 --> 05:21.690
So let's do this and let's have a look.

05:21.700 --> 05:28.630
So here we have in the very last row of our maximum sharp racial portfolio with some return of 25 percent

05:28.630 --> 05:35.790
a risk of 20 percent and the maximum Sharpe ratio of one point nineteen six.

05:35.800 --> 05:39.670
And finally of course we can also visualize our results here.

05:39.670 --> 05:45.300
So we create a scatter blood again with all of our 100000 portfolios.

05:45.400 --> 05:53.410
And on the x axis we have the risk and on the y axis the return and the color is determined by the sharp

05:53.410 --> 05:54.400
ratio.

05:54.520 --> 06:02.030
And we also create a point or a star with the the maximum Sharpe Ratio portfolio.

06:02.050 --> 06:03.880
So it's a black star here.

06:03.880 --> 06:05.410
And uh let's have a look.

06:08.850 --> 06:12.500
So here we have our 100000 portfolios.

06:12.600 --> 06:20.910
And here is the Black Star we can see the maximum sharp ratio portfolio that we derive to with our optimization

06:20.910 --> 06:22.290
algorithm.

06:22.320 --> 06:27.330
So that's the very best portfolio that we could have created five years ago.

06:27.330 --> 06:35.010
So for the period of the last five years and actually you might ask yourself why exactly this portfolio

06:35.010 --> 06:40.980
is here the maximum Sharpe Ratio portfolio so it could also be another portfolio here on the efficient

06:40.980 --> 06:41.610
frontier.

06:41.610 --> 06:48.980
So for example this one and exactly this question I have a hand and answer in the next video.

06:48.990 --> 06:50.490
So I hope to see you there by.
